package ch07;

import java.io.InputStream;
import java.io.OutputStream;
import java.util.EnumMap;
import java.util.EnumSet;
import java.util.Properties;
import java.util.Set;
import java.nio.file.Files;
import java.nio.file.Paths;

public class Main {

    public static void main(String[] args) {
        // Properties settings = new Properties();
        Properties settings = System.getProperties();

        // settings.put("width", "200");
        // settings.put("title", "Hello, world!");
        // System.out.println(settings);
        // try (OutputStream out = Files.newOutputStream(Paths.get("./ch07/test"))){
        //     settings.store(out, "Program Properties");
        // } catch (Exception e) {
        //     //TODO: handle exception
        // }

        // try (InputStream in = Files.newInputStream(Paths.get("./ch07/test"))) {
        //     settings.load(in);
        //     System.out.println(settings.getProperty("title"));
        // } catch (Exception e) {
        //     //TODO: handle exception
        // }

        // System.out.println(System.getProperties());

        Set<Weekday> always = EnumSet.allOf(Weekday.class);
        Set<Weekday> never = EnumSet.noneOf(Weekday.class);
        Set<Weekday> workday = EnumSet.range(Weekday.MONDAY, Weekday.FRIDAY);
        Set<Weekday> mwf = EnumSet.of(Weekday.MONDAY, Weekday.WEDNESDAY, Weekday.FRIDAY);
        System.out.println(always);
        // System.out.println(never);
        // System.out.println(workday);
        // System.out.println(mwf);

        EnumMap<Weekday, String> personInCharge = new EnumMap<>(Weekday.class);
        personInCharge.put(Weekday.MONDAY, "Fred");
        System.out.println(personInCharge);
    }
}